.darken() {
	-webkit-filter: brightness(.9);
	filter: brightness(.9);
}
.clearDarken() {
	-webkit-filter: none;
	filter: none;
}
.colorButton(@color) {
	background: @color;
	&:active {
		.darken;
	}
}
.textNoWrap() {
	white-space: nowrap;
	text-overflow: ellipsis;
	overflow: hidden;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}
html,body {
	font-family: "Microsoft YaHei";
	font-size: 62.5%;
}

@field-height: 2rem;
@field-radius: 3px;
@field-icon-width: 1.5rem;

.cell {
	display: table-cell;
	vertical-align: middle;
	position: relative;
	&.expand {
		width: 100%;
	}
	&.center {
		text-align: center;
	}
}
.hpanel {
	color: #899;
	font-size: 20px;
	padding-left: 10px;
	.rel-mid-wrap>div {
		padding-right: 10px;
		&>* {
			.darken;
			&:hover {
				.clearDarken;
			}
		}
	}
	&.abs {
		height: 100%;
		position: absolute;
		right: 0;
		top: 0;
	}
}
.rel-mid-wrap {
	// simpler than .abs-mid-wrap but width will be affected by children
	display: table;
	height: 100%;
	&>* {
		display: table-cell;
		vertical-align: middle;
	}
}
.abs-mid-wrap {
	// width will be fixed and not affected by children
	// font-size must be reset in children
	position: absolute;
	top: 0;
	bottom: 0;
	font-size: 0;
	&>*,&::after {
		display: inline-block;
		vertical-align: middle;
	}
	&::after {
		content: '.';
		width: 0;
		height: 100%;
		//overflow: hidden;
	}
	&.left {
		left: 0;
	}
	&.right {
		right: 0;
	}
}

@import 'styles/bookmark.less';
@import 'styles/collection.less';
@import 'styles/editable.less';

.buttons {
	button {
		font-size: 1rem;
		cursor: pointer;
		height: @field-height;
		border: none;
		margin-bottom: .5rem;
	}
}
button {
	&.primary {
		color: white;
		.colorButton(rgb(34,143,189));
	}
	&.secondary {
		color: white;
		.colorButton(brown);
	}
}

.circleButton(@size,@color,@bgcolor) {
	text-align: center;
	width: @size;
	height: @size;
	line-height: @size;
	color: @color;
	&:hover {
		background: @bgcolor;
	}
}

@side-width: 280px;
@bookmark-button-size: 2rem;
@menu-height: 35px;

body {
	background: white;
}
.menu {
	position: fixed;
	height: @menu-height;
	width: @menu-height;
	z-index: 100;
}
.menu-expand {
	transition: all .5s;
	position: absolute;
	left: 50%;
	top: 0;
}
.menu-button {
	position: absolute;
	top: 0;
	opacity: 1;
	cursor: pointer;
	color: black;
	border-radius: 50%;
	border: 1px solid #789;
	background: white;
	display: block;
	width: @menu-height;
	height: @menu-height;
	line-height: @menu-height;
	font-size: 14px;
	text-align: center;
	transition: all .5s;
	.ng-hide & {
		opacity: 0;
	}
	&:not(:hover) {
		.darken;
	}
}
.menu-main {
	z-index: 101;
	box-shadow: 0 0 10px black;
	&:not(:hover) {
		opacity: .8;
	}
}
.menu-words {
	width: auto;
	white-space: nowrap;
	border-radius: 10px;
	padding: 0 10px;
}
.side {
	z-index: 1;
	top: 0;
	bottom: 0;
	font-size: 1rem;
	position: fixed;
	overflow: auto;
	.padded {
		padding: 0 40px;
	}
	.left {
		float: left;
	}
	.right {
		float: right;
	}
	.field {
		width: 100%;
		position: relative;
	}
	&.left {
		width: @side-width;
		left: 0;
	}
}
.field {
	margin-bottom: .5rem;
	position: relative;
	&>textarea {
		height: 5em;
		width: 100%;
		border: none;
		resize: none;
	}
	&>input {
		line-height: @field-height;
		width: 100%;
		outline: none;
		border: none;
	}
	&.newcol {
		&>input {
			line-height: 3rem;
			padding: 0 1rem;
			text-align: center;
			&.active {
				padding-right: 50px;
			}
		}
		.button {
			cursor: pointer;
			margin-right: 5px;
			color: #ccc;
			&:hover {
				color: rgb(34,143,189);
			}
		}
	}
	.abs-mid-wrap>* {
		font-size: @field-height;
	}
}

.user {
	position: absolute;
	right: 10px;
	top: 0;
	padding: 10px;
	&>.card {
		background: white;
		position: absolute;
		box-shadow: -2px 2px 4px #ccc;
		right: 0;
		top: 100%;
		width: 200px;
		z-index: 10;
		padding: 10px;
	}
	.field {
		&>input {
			border: 1px solid gray;
			border-radius: @field-radius;
			padding: 0 .5rem 0 @field-icon-width;
			&:focus {
				&~.fa {
					color: darken(#ccc,20%);
				}
				border-color: dodgerblue;
			}
		}
		&>.fa {
			color: #ccc;
			position: absolute;
			left: 0;
			top: 0;
			width: @field-icon-width;
			line-height: @field-height;
			text-align: center;
		}
	}
	.name {
		cursor: pointer;
		.guest {
			.darken;
		}
	}
}
.toc {
	@footer-height: 30px;
	color: white;
	background: #567;
	.content {
		padding: 15px;
		position: absolute;
		top: 0;
		bottom: @footer-height;
	}
	.listview {
		position: absolute;
		top: 100px;
		left: 15px;
		right: 15px;
		bottom: 15px;
		overflow-y: auto;
	}
	.nested {
		position: absolute;
		transition: top .5s,left .5s;
		&.dragging,&.ng-leave {
			z-index: 10;
			transition: none;
		}
	}
	.collections {
		margin-top: 15px;
	}
	.footer {
		position: absolute;
		bottom: 0;
		left: 0;
		width: 100%;
		height: @footer-height;
		padding: 0 20px;
		.wrap {
			position: relative;
		}
		.popup {
			position: absolute;
			bottom: 5px;
			left: 0;
			background: white;
			border: 1px solid gray;
			&>a {
				display: block;
				color: gray;
				cursor: pointer;
				padding: 0 10px;
				line-height: 35px;
				text-decoration: none;
				&:hover {
					background: #eee;
				}
			}
		}
		.fa {
			font-size: 20px;
			width: 30px;
			height: 30px;
			line-height: 30px;
			text-align: center;
			cursor: pointer;
		}
	}
	::-webkit-scrollbar {
		width: 10px;
		height: 10px;
		background: #456;
	}
	::-webkit-scrollbar-thumb {
		background: #9ab;
		border-radius: 5px;
	}
	::-webkit-scrollbar-corner {
		background: #456;
	}
}
.bookmarks {
	@header-height: 100px;
	background: #def;
	padding: 0 10px;
	position: relative;
	.avatar {
		cursor: pointer;
		padding-right: 10px;
		img {
			width: 40px;
			height: 40px;
			border-radius: 50%;
			display: block;
		}
	}
	.path {
		padding: 10px 0 5px;
	}
	.current {
		font-size: 16px;
	}
	.header {
		height: @header-height;
		padding: 10px 0;
		border-bottom: 1px solid #899;
		.right {
			float: right;
		}
		button {
			padding: 3px;
			border-radius: @field-radius;
			width: 60px;
		}
	}
	.list {
		overflow-y: auto;
		position: absolute;
		top: @header-height;
		left: 10px;
		right: 10px;
		bottom: 10px;
	}
	.hpanel {
		background: #def;
	}
}
button {
	&.sign {
		.colorButton(rgb(34,143,189));
		color: white;
		width: 80px;
		border-radius: @field-radius;
	}
	&.remove {
		.colorButton(brown);
		color: white;
	}
}
#center {
	padding-left: @side-width;
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	right: 0;
	.main {
		background: rgb(204,204,204);
	}
}
.fill-wrap {
	width: 100%;
	height: 100%;
	tr:not(.expand) {
		height: 1px;
	}
	tr.expand {
		td {
			vertical-align: top;
		}
	}
}
.abs-fill-wrap {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
}
.views {
	display: inline-block;
	font-size: 0;
	margin-right: 10px;
	i {
		font-size: 18px;
		padding: 3px 10px;
		cursor: pointer;
		border: 1px solid gray;
		background: #ccc;
		&:not(.active) {
			background: #eee;
			box-shadow: 0 1px 1px #bbb;
		}
		&:first-child {
			border-top-left-radius: 5px;
			border-bottom-left-radius: 5px;
		}
		&:last-child {
			border-top-right-radius: 5px;
			border-bottom-right-radius: 5px;
		}
		&:not(:last-child) {
			border-right: none;
		}
	}
}
.search {
	display: inline-block;
	position: relative;
	width: 300px;
	font-size: 14px;
	input {
		padding: 5px 30px 5px 10px;
		width: 100%;
		height: 30px;
		border: 1px solid #aaa;
		border-radius: 5px;
		outline: none;
		&:focus {
			border-color: #555;
			&~i {
				color: #555;
			}
		}
	}
	i {
		cursor: pointer;
		color: #aaa;
		position: absolute;
		right: 10px;
		top: 0;
		line-height: 30px;
	}
}
